package dyyx.dto;

import org.apache.zookeeper.data.Stat;

public class NodeData{

	public final String path;
	public final byte[] data;
	public final Stat stat;
	public final String dataStr;
	public final long createTime;


	
    public NodeData(String path,byte[] data,Stat stat)throws Exception{
    	this.path = path;
    	this.data = data;
    	this.stat = stat;
    	if(data!=null){
    		this.dataStr = new String(data,"utf8");
    	}else{
    		this.dataStr = null;
    	}
    	createTime = System.currentTimeMillis();
    	
    }

	public final int getNumChildren(){
		return stat.getNumChildren();
	}
	
	

}
